using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Main.controls
{
    public partial class ShowProfile : System.Web.UI.UserControl
    {
        private MembershipUser currentUser;
        private Guid _UserID;
        public Guid UserID
        {
            get
            { return _UserID; }
            set
            { _UserID = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            currentUser = Membership.GetUser(UserID);
            this.username.Text = currentUser.UserName;
            this.emailAddress.Text = currentUser.Email;
            //We'll do it this way for now, but I'd like
            //to do something else later. Like, maybe
            //display recent polls or if we are just going 
            //to display a count, just do a Count rather than
            //a select
            PollCollection polls = new PollCollection();
            polls.FillAllForUser(UserID);
            this.pollCount.Text = polls.Count.ToString();
        }
    }
}